<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include 'sections/head.phtml'; ?>
<script type="text/javascript">
$(document).ready(function(){
	$('#add_another_image').click(function(event){
		if($('input[type="file"]').length>=5){
			alert('Maximum allowed images reached');
			return false;
		}
		//alert('yes');
		var itm=document.createElement('input');
		itm.type='file';
		itm.name='image[]';
		itm.style.display='block';
		console.log(itm);
		$(itm).insertBefore(this);
		event.preventDefault();
	});
	
});

</script>
</head>
<body id="computer" class="root4">
<?php $items = view::newInstance()->_get('main_categories'); ?>
<?php include 'sections/header.phtml'; ?>
<div class="clearfix"></div>
<div id="container" class="w"> 
  <!-- SIDE BAR -->
  <?php include 'sections/sidebar.phtml'; ?>
<!-- MAIN CONTENT AREA -->
<div id="content-area">
  <div id="m-bcrm" class="clearfix"> <?php echo breadcrumb::newInstance()->render(); ?> </div>
  <div id="posting_form">
    <form method="post" action="<?php echo site_url(); ?>item/save/" enctype="multipart/form-data" name="add_posting" id="post-an-ad" class="prevent-enter-key">
		<input type="hidden" name="max_image_count" id="max_image_count" value="5" />
		<input type="hidden" name="category_id" value="<?php echo $_GET['category_id']; ?>" />
		<input type="hidden" name="location_id" value="<?php echo $_GET['location_id']; ?>" />
	 <fieldset>
        <h2 class="first">Describe what's in your ad</h2>
        <div class="information message">
          <p class="yay">It's FREE to post this ad</p>
          <p class="subyay">You're posting an ad in <strong><a href="" title="Reading">Reading</a></strong> for 60 days.</p>
          <p class="subyay">All of the fields marked with * need to be filled in.</p>
        </div>
        <ul class="striped">
          <li class="odd">
            <label for="title"> Ad title* <span class="note" id="title-counter"><strong>100</strong> characters left</span> </label>
            <div class="fields">
              <input class="required text long character-count" maxlength="100" name="title" id="title" value="" tabindex="1">
            </div>
            <div class="help">
              <div class="content">
                <p> Content will be here</p>
              </div>
            </div>
            <div id="feature-urgent7-field" class="fields">
              <label id="feature-urgent7-label" class="checkbox" for="urgent">
                <input type="checkbox" class="checkbox" name="urgent" id="urgent" tabindex="2">
                <strong class="urgent">Urgent</strong> 7 Days - &pound;1.00. </label>
              <p>Want attention? Use this to grab some attention in listings. <a href="#about-urgent-ads" class="modal" title="Learn more">Learn more</a></p>
              <div class="clear"></div>
            </div>
          </li>
          <li class="even">
            <label for="description"> Description* <span class="note hidden" id="description-counter"><strong>6000</strong> characters left</span> </label>
            <div class="fields">
              <textarea class="required character-count" rows="13" cols="35" name="description" id="description" maxlength="6000" tabindex="3"></textarea>
            </div>
            <div class="help">
              <div class="content">
                <p> Content will be here</p>
                <p> content will be here</p>
              </div>
            </div>
          </li>
          <li class="odd">
            <label for="location">Local area</label>
            <div class="fields">
              <label class="example" for="location">e.g. Bracknell</label>
              <label class="sub-example" for="location">, Reading</label>
              <input class="required exampled short text" maxlength="35" name="local_location" id="location" value="" tabindex="4">
            </div>
            <div class="help">
              <div class="content">
                <p>Make your ad easier to find by telling us your area, town</p>
              </div>
            </div>
          </li>
          <li class="even">
            <label for="postcode"> Postcode <span class="note optional">Recommended</span> <span class="note"><a href="http://www2.royalmail.com/postcode-finder?gear=postcode" target="_blank">Don't know your full postcode?</a></span> </label>
            <div class="fields">
              <input class="short text" type="text" maxlength="8" name="postcode" id="postcode" value="" tabindex="5">
              <label for="postcode-visible" class="checkbox postcode-visible-label">
                <input type="checkbox" class="checkbox" name="postcode_visible" id="postcode-visible" value="1" checked="checked" tabindex="6">
                Use this postcode to place my ad on a map </label>
            </div>
            <div class="help">
              <div class="content">
                <p>Detail will be here </p>
              </div>
            </div>
          </li>
          <li class="odd">
            <div class="information message">
              <p>Get <strong>twice the number of replies to your ad</strong> by adding pictures.</p>
            </div>
            <label for="pictures"> Pictures </label>
            <div class="fields"> <span class="button secondary">
             <input type="file" name="image[]" />
			 <a href="#" id="add_another_image">Add Another</a>
              </span> </div>
          </li>
          <li class="even">
            <label for="youtube-url"> YouTube video URL </label>
            <div class="fields">
              <label class="favicon" id="youtube" for="youtube-url"> YouTube </label>
              <label class="example with-favicon" for="youtube-url">http://</label>
              <input type="text" class="long exampled text with-favicon" name="video_url" id="youtube-url" value="" maxlength="150" tabindex="8">
            </div>
            <div class="help">
              <div class="content">
                <p></p>
              </div>
            </div>
          </li>
        </ul>
      </fieldset>
      <fieldset class="actions">
        <input type="hidden" name="policy_accepted" value="1">
        
        <p>By clicking 'Post Ad', you agree to Myhighst's <a href="#" target="_blank">terms of service</a> and <a href="/help/posting_rules" target="_blank">posting rules</a>.</p>
        <span class="button primary">
        <input type="submit" name="action_post" id="action-post" value="Post Ad" tabindex="24">
        </span> <span class="button secondary">
        <input type="submit" name="action_preview" id="action-preview" value="Preview Ad" tabindex="25">
        </span>
      </fieldset>
    </form>
  </div>
</div>
<span class="clearfix"></span>
<?php include 'sections/footer.phtml'; ?>
</body>
</html>